<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
  <title>Tinymce mobile demo</title>
  <style>
    img{ max-width: 100%!important; }
  </style>
</head>
<body>

  <p>随风奔跑自由是方向！！！</p>

  <textarea id="editor"></textarea>

  <p>追逐雷和闪电的力量！！</p>

  <script src="tinymce/tinymce.min.js"></script>
  <script src="tinymce/langs/zh_CN.js"></script>

  <script>
    var ele = document.querySelector('#editor');
    var editor = tinymce.init({
      target: ele,
      language: 'zh_CN',
      height: 350,
      mobile: {
        theme: 'mobile',
        menubar: false,
        plugins: 'image media lists imagetools',
        toolbar: 'undo redo bold italic image media bullist numlist imagePicker'
      },
      content_css: 'app.css',
      images_upload_handler: function(blobinfo, success, failure) {
        // success('https://cdn4.buysellads.net/uu/1/3386/1525189943-38523.png')
      },
      file_picker_callback: function(callback, value, meta) {

      },
      setup: function(editor) {
        console.log(editor)
        editor.ui.registry.addButton('imagePicker', {
          icon: 'image',
          onAction: function() {
            
          }
        })
      }
    }).then(function(editors) {
      // tinymce.activeEditor.uploadImages(function(success) {
      //   // document.forms[0].submit();
      // });
      // editors[0].execCommand('mceImage')
    })


    function pickFile(options) {
      var ele = document.createElement('input');
      ele.type = 'file';
      ele.click();
    }
  </script>
  
</body>
</html>